<template>
  <div class="sq-content">
    <div class="box-flex">
      <div class="left-box">
        <div style="width: 33%; margin-right: 15px">
          <sjzl :allData="allData"></sjzl>
          <gzzy :allData="allData"></gzzy>
        </div>

        <div style="width: 36%; margin-right: 15px">
          <sqgk :allData="allData"></sqgk>
          <sjtj :allData="allData"></sjtj>
        </div>
        <div style="width: 30%; margin-right: 15px">
          <zdsj></zdsj>
        </div>
      </div>
    </div>
    <div class="bottom-box">
      <dbqd style="width: 50%"></dbqd>
      <xcdb style="width: 50%"></xcdb>
    </div>
  </div>
</template>
<script setup>
import { ScaleMin } from "@/utils/screen-scale-mixin.js";
const { scaleStyle } = ScaleMin();
import LabelTitle from "@/components/labeltitle.vue";
import { onMounted } from "vue";
import sjzl from "./component/sq-zhsj.vue";
import gzzy from "./component/sq-gzzy.vue";
import sqgk from "./component/sq-sqgk.vue";
import sjtj from "./component/sq-sjtj.vue";
import sjzldy from "./component/sjzldy.vue";
import sjlxfx from "./component/sjlxfx.vue";
import zxsj from "./component/zxsj.vue";
import dbqd from "./component/dbqd.vue";
import cygj from "./component/cygj.vue";
import xcdb from "./component/xcdb.vue";
import fwss from "./component/gggl-fwss.vue";
import ggaqqylx from "./component/ggaq-qylxfx.vue";
import ggaqyhpafx from "./component/ggaq-yhpazg.vue";
import zdsj from "./component/sq-zdsj.vue";
import { useUserStore } from "@/pinia/user.js";
import { getzhsj, getsjlyqszfx, gethyhpcfx, getqylx } from "@/api/ggaq.js";
const piniaUser = useUserStore();

let currentTime = ref(7);
const selectTime = (time) => {
  currentTime.value = time;
  getData();
};

let allData = ref({});
let sjzlData = ref({});
let qylxOptions = ref({});
let yhpaOptions = ref({});
const getData = async () => {
  try {
    const [res1, res2, res3] = await Promise.all([
      getsjlyqszfx({ dimension: currentTime.value }),
      getqylx({ dimension: currentTime.value }),
      gethyhpcfx({ dimension: "LastLastYear" }),
    ]);

    allData.value = res1.data;
    qylxOptions.value = res2.data;
    yhpaOptions.value = res3.data;
  } catch (e) {
    console.error("首页报错", e);
  }
};

onMounted(() => {
  getData();
});
</script>
<style lang="scss" scoped>
.sq-content {
  width: 100%;
  // height: 100%;
  position: relative;
  border: 1px solid transparent;

  .box-flex {
    // margin-top: 20px;
    width: 100%;
    // height: calc(100% - 60px);
    // display: flex;
    // align-items: top;
    .left-box {
      width: 100%;
      display: flex;
      align-items: top;
      // flex-wrap: wrap;
    }
    // .right-box {
    //   width: 308px;
    //   height: 100%;
    //   margin-left: 20px;
    // }
  }
  .bottom-box {
    height: calc(100% - 320px);
    display: flex;
    align-items: top;
  }
}
</style>
